<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class giaovien extends CI_Controller {
	public function __construct() {
		parent::__construct();
		$this->load->model('model_giaovien');
		date_default_timezone_set("Asia/Ho_Chi_Minh");
	}

	public function index(){
		$data['giaovien'] = $this->model_giaovien->layGiaoVien();

		$this->load->view("view_header");
		$this->load->view("view_login");
		$this->load->view("view_body_giaovien",$data);
		$this->load->view("view_footer");
	}

	public function chitietgiaovien($magiaovien){
		$data['chitietgiaovien'] = $this->model_giaovien->layChiTietGiaoVien($magiaovien);

		$this->load->view("view_header");
		$this->load->view("view_login");
		$this->load->view("view_body_chitietgiaovien",$data);
		$this->load->view("view_footer");
	}
	public function timgiaovien(){
		if($_POST['daymon'] != 'Tất Cả')
		{
			$data['giaovien'] = $this->model_giaovien->timgiaovien($_POST['daymon'], $_POST['tengiaovien']);
		}
		else
		{
			$data['giaovien'] = $this->model_giaovien->timgiaovien2($_POST['tengiaovien']);
		}

		$this->load->view("view_header");
		$this->load->view("view_login");
		$this->load->view("view_body_giaovien",$data);
		$this->load->view("view_footer");
	}
}